Skip to content

Improve create placeholder#199

Merged
dajimenezriv-internxt merged 9 commits intomasterfrom
improve-create-placeholder
Sep 24, 2025
Merged

Improve create placeholder#199
dajimenezriv-internxt merged 9 commits intomasterfrom
improve-create-placeholder

Conversation

@dajimenezriv-internxt
Copy link
Contributor

@dajimenezriv-internxt dajimenezriv-internxt commented Sep 23, 2025

What

Improve the args handler in create file and folder placeholder and also remove some args that were not used, like itemAttributes.

@dajimenezriv-internxt dajimenezriv-internxt self-assigned this Sep 23, 2025
inline static LARGE_INTEGER FileTimeToLargeInteger(_In_ const FILETIME fileTime)
{
inline static LARGE_INTEGER JsTimestampToLargeInteger(int64_t jsTimestamp) {
const int64_t EPOCH_DIFFERENCE = 11644473600000LL;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was done in a function in javascript:

  private convertToWindowsTime(jsTime: number) {
    return BigInt(jsTime) * 10000n + 116444736000000000n;
  }

However, now we move all conversations from the date number in javascript to C++.

return result;
}

if (isDirectory) // TODO: the function createEntry is used to create only folders (directories), so this if is always true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we have just removed the if as the TODO says. This was just used only for folders.

L"Unable to free up space because the file is currently in use.\nPlease close the file and try again.",
L"File in use",
MB_OK | MB_ICONWARNING | MB_SYSTEMMODAL);
// MessageBoxW(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the MessageBox displayed when a file was in used, however, currently we have some files that are locked and this MessageBox is displayed everytime. This error is already in prod, for now we just log it and ignore.

@@ -1,93 +1,25 @@
#include <Windows.h>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we just replace all parse values with the new template napi_extract_args and convert the datetime values to a windows format (LARGE_INTEGER).

@@ -1,94 +1,24 @@
#include <Windows.h>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we just replace all parse values with the new template napi_extract_args and convert the datetime values to a windows format (LARGE_INTEGER).

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@dajimenezriv-internxt dajimenezriv-internxt merged commit 2513540 into master Sep 24, 2025
3 of 4 checks passed
@dajimenezriv-internxt dajimenezriv-internxt deleted the improve-create-placeholder branch September 24, 2025 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants